<!--[if IE]> <![if !IE]> <![endif]-->
<link href="<?php echo base_url(); ?>css/recall/paper_style.css" rel="stylesheet" type="text/css" />
<!--[if IE]> <![endif]> <![endif]-->
<!--[if IE]>
<link href="<?php echo base_url(); ?>css/recall/paper_style_ie.css" rel="stylesheet" type="text/css" />
<![endif]-->

<script type="text/javascript" src="../../../../ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.js"></script>
<script type="text/javascript"> 
$(document).ready(function(){
	$(".show_up0").click(function(){
		$(this).hide();
		$('li.do_hidden_gs_'+$(this).children('input').val()).slideDown();
		return false;
	  });
	$(".show_up1").click(function(){
		$(this).hide();
		$('li.do_hidden_jc_'+$(this).children('input').val()).slideDown();
		return false;
	});
	$(".jc_btn").click(function(){
		$(this).css('background-color', 'orange');
		$(this).css('color', 'white');
		$(this).siblings('.gs_btn').css('background-color', 'white');
		$(this).siblings('.gs_btn').css('color', 'black');
		$(this).parent().parent().children('.gs_sec').hide();
		$(this).parent().parent().children('.jc_sec').slideToggle();
		return false;
	});
	$(".gs_btn").click(function(){
		$(this).css('background-color', 'orange');
		$(this).css('color', 'white');
		$(this).siblings('.jc_btn').css('background-color', 'white');
		$(this).siblings('.jc_btn').css('color', 'black');
		$(this).parent().parent().children('.jc_sec').hide();
		$(this).parent().parent().children('.gs_sec').slideToggle();
		return false;
	});
});
function button()
{
//	document.form.tijiao.disabled="false";
//	document.form.submit();
//	return false;

//	$('#submit2').disabled();
//	$('#submit2').parent.submit();
	$('.submit').hide();
	$('.submit_new').hide();
	return false;
}
</script>
<div id="center">
	<div id="left_column">
		<div id="content">
			<h2><?php echo $paper->title; ?></h2>
			<ul class="probs">
				<?php $cnt=0;?>
				<?php foreach($problems as $row): ?>
					<li>
						<div class="prob_content"><?php echo $row->content; ?></div>
						<div class="prob_info">
							<span class="sub_word">作者</span><?php echo $this->user_model->get_user_name($row->u_id); ?>&nbsp;
							<span class="sub_word">时间</span><?php echo $row->creat_time; ?>
						</div>
						<div class="prob_extra">
							<form action="<?php echo site_url('recall/recall_main/add_bad'); ?>" method="POST" style="float:right;">
								<input type="hidden" id="j_id" name="j_id" value="<?php echo $row->j_id ?>" />
								<input type="hidden" id="t_id" name="t_id" value="<?php echo $row->t_id ?>" />
								<div class="submit" style="width:80px;" ><input type='submit' value="坏评(<?php echo $row->bad_cnt; ?>)" nclick="button();"/></div>
							</form>						
							<form action="<?php echo site_url('recall/recall_main/add_good'); ?>" method="POST" style="float:right;">
								<input type="hidden" id="j_id" name="j_id" value="<?php echo $row->j_id ?>" />
								<input type="hidden" id="t_id" name="t_id" value="<?php echo $row->t_id ?>" />
								<div class="submit"><input type='submit' value="好评(<?php echo $row->good_cnt; ?>)" onclick="button();"/></div>
							</form>
							<a href=<?php echo site_url('recall/recall_main/modify_problem/'.$row->t_id)?>>修改此题</a>
						</div>
						<!--hr class="content_hr" /-->
						<div style="clear:both"></div>
						<hr />
						<div id="contentcontent">
							<div>
								<a href="#" class="jc_btn" >纠错区(<?php echo $row->rply_type1_cnt;?>)</a>/<a href="#" class="gs_btn" style="color:black;">灌水区(<?php echo $row->rply_type0_cnt; ?>)</a>
							</div>
							<ul class="reply jc_sec" style="display:none;">
								<?php $cnt_tmp = 0; ?>
								<?php foreach($com_type1[$cnt] as $com_row):?>
									<?php 
										++$cnt_tmp;
										if ($row->rply_type1_cnt > 2 && $cnt_tmp > 1 && $cnt_tmp < $row->rply_type1_cnt):
									?>
										<li class="<?php echo 'do_hidden_jc_'.($row->t_id); ?>" style="display:none;">
									<?php else: ?>
										<?php 
										if ($row->rply_type1_cnt > 2 && $cnt_tmp == $row->rply_type1_cnt) 
											echo '<div class="show_up1"  style="margin-top:-6px; margin-bottom: 5px; border-bottom: 1px solid; text-align: center;"><input type="hidden" value="'.$row->t_id.'" /><a href="#" class="show_more">显示所有内容</a></div>';
										?>
									<?php endif; ?>
									<li class="no_hidden">
										<span class="girl_name"><?php echo $this->user_model->get_user_name($com_row->u_id); ?></span>&nbsp;说：
										<span class="speech"><?php echo $com_row->content; ?></span>
										<br />
										<div style="clear:both"></div>
										<span class="sub_word" style="float:right;"><?php echo $com_row->creat_time; ?></span>
										<div style="clear:both"></div>
										<hr />
									</li>
								<?php endforeach;?>
								<br />
								我要纠错：
								<form action="<?php echo site_url('recall/recall_main/add_com'); ?>" method="POST">
									<input type="hidden" id="j_id" name="j_id" value="<?php echo $row->j_id ?>" />
									<input type="hidden" id="t_id" name="t_id" value="<?php echo $row->t_id ?>" />
									<input type="hidden" id="type" name="type" value=1 />
									<textarea rows="4" cols="50" id="c_content" name="c_content" ></textarea>
									<div class="submit"><input type='submit' value='提交' onclick="button();"/></div>
								</form>
							</ul>
							<br />
							<ul class="reply gs_sec" style="display:none;">
								<?php $cnt_tmp = 0; ?>
								<?php foreach($com_type0[$cnt] as $com_row):?>
									<?php 
										++$cnt_tmp;
										if ($row->rply_type0_cnt > 2 && $cnt_tmp > 1 && $cnt_tmp < $row->rply_type0_cnt):
									?>
									<li class="<?php echo 'do_hidden_gs_'.($row->t_id); ?>" style="display:none;">
									<?php else: ?>
									<?php if ($row->rply_type0_cnt > 2 && $cnt_tmp == $row->rply_type0_cnt)
										echo '<div class="show_up0" style="margin-top:-6px; margin-bottom: 5px; border-bottom: 1px solid; text-align: center;"><input type="hidden" value="'.$row->t_id.'" /><a href="#" class="show_more">显示所有内容</a></div>';
									?>
									<li class="no_hidden">
										<?php endif; ?>
											<span class="boy_name"><?php echo $this->user_model->get_user_name($com_row->u_id);  ?></span>&nbsp;说：
											<span class="speech"><?php echo $com_row->content; ?></span>
											<br />
											<div style="clear:both"></div>
											<span class="sub_word" style="float:right;clear:both;"><?php echo $com_row->creat_time; ?></span>
											<div style="clear:both"></div>
											<hr />
									</li>
								<?php endforeach;?>
								<br />
								我要灌水：
								<form action="<?php echo site_url('recall/recall_main/add_com'); ?>" method="POST">
									<input type="hidden" id="j_id" name="j_id" value="<?php echo $row->j_id ?>" />
									<input type="hidden" id="t_id" name="t_id" value="<?php echo $row->t_id ?>" />
									<input type="hidden" id="type" name="type" value=0 />
									<textarea rows="4" cols="50" id="c_content" name="c_content" ></textarea>
									<div class="submit"><input type='submit' value='提交' onclick="button()"/></div>
								</form>
							</ul>
						</div>
					</li>
					<hr class="content_hr" />
					<?php $cnt++;?>
				<?php endforeach; ?>
			</ul>
		</div id="content">
		<div id="increase">
			<span class="right_column">我要补充新题：<hr/></span>
				<form action="<?php echo site_url('recall/recall_main/add_problem'); ?>" method="POST">
					<input type="hidden" id="j_id" name="j_id" value="<?php echo $paper->j_id ?>" />
					<div style="text-align:center;">
						<textarea class="ckeditor" rows="4" cols="70" id="pcontent" name="pcontent" >
						</textarea>

						<script type="text/javascript">
							CKEDITOR.replace( 'mydescription' ); 
						</script>
					</div>
					<div class="submit_new"><input type='submit' value='提交' onclick="button();"/></div>
				</form>
				<!--<a href=<?php echo site_url('recall/recall_main/index')?>>返回</a>-->
		</div id="increase">
	</div id="left_column">
	<div id="right_column">
    	<div id="inform_block" style="overflow:auto;">
			<span class="right_column">
				<strong>试卷标题：</strong><br />
				<div class="right_content"><?php echo $paper->title; ?><br /></div>
			</span>
			<span class="right_column"><strong>创&nbsp;&nbsp;建&nbsp;&nbsp;者：</strong>&nbsp;&nbsp;<?php echo $this->user_model->get_user_name($paper->u_id); ?><br /></span>
			<span class="right_column"><strong>创建时间：<br /></strong>
				<div class="right_content"><?php echo $paper->creat_time; ?><br /></span></div>
			</span>
			<span class="right_column"><strong>最后修改时间：<br /></strong>
				<div class="right_content"><?php echo $paper->latest_alter_time; ?><br /></div>
			</span>
			<span class="right_column"><strong>描述：<br /></strong>
				<div class="right_content"><?php echo $paper->dscript; ?><br /></div>
			</span>
			<br />
			<?php 
				if ($paper->problem_cnt > 0) 
				{
					echo'<span class="right_column"><strong>此试卷已经过：</strong><span style="color:#666;">';
					echo $this->user_model->get_user_name($problems[($paper->problem_cnt)-1]->u_id);
					echo'</span><strong>等</strong><span style="color:red;">';
					echo $paper->problem_cnt;
					echo'</span><strong>人修改</strong></span>';
				}
				else 
					echo'<span class="right_column"><strong>此试卷目前为空试卷。</strong></strong></span>'
			?>
		</div>
        <div id="tag_block" style="overflow:auto;">
        	<span class="right_column"><strong>关键字/Tags<hr/></strong>
				<div class="right_content"><?php echo $paper->tags; ?></div>
			</span>
		</div>
        <div id="link_block" style="overflow:auto;">
        	<span class="right_column"><strong>相关试卷/Links<hr/></strong>
				<div class="right_content"><?php ?></div>
			</span>
		</div>

	
	</div>
	
	<p></p>

	<br />




</div>
</div>
